<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>仿造苏宁移动布局</title>
</head>

<body>
    <div class="main">
        <header>
            <div class="search">
                <div class="search_img"></div>
            </div>
        </header>

        <div class="content">

        </div>

        <footer>

        </footer>
    </div>
</body>



<script>
window.onresize=function(){
    //document对象是文档的根节点，每张网页都有自己的document对象只要浏览器开始载入 HTML 文档，该对象就存在了，可以直接使用
    console.log(document)
    console.log(document.documentElement.clientWidth)
    // 获取html的dom
    let htmlDom = document.getElementsByTagName('html')[0];
    htmlDom.style.fontSize = document.documentElement.clientWidth / 15 + 'px';
    console.log(htmlDom.style.fontSize);
   }
</script>


<style>
    /* @media screen and (min-width:360px) {
        html {
            font-size: 24px;
        }
    }

    @media screen and (min-width:375px) {
        html {
            font-size: 25px;
        }
    }

    @media screen and (min-width:820px) {
        html {
            font-size: 54.66px;
        }
    } */



    body {
        margin: 0;
    }

    header {
        text-align: center;
        padding-top: 0.5rem;
    }

    .main {
        height: 300px;
        background-color: aliceblue;
        text-align: center;
    }



    .search {
        width: 14.04rem;
        height: 1.6rem;
        line-height: 1.6rem;
        background-color: beige;
        margin: 0 auto;
        border-radius: 0.75rem;

    }

    .search_img {
        width: 0.75rem;
        height: 0.75rem;
        background-size: 0.7rem 0.75rem;
        background-image: url();
    }
</style>


</html>